package cn.enilu.flash.warpper;

import cn.enilu.flash.enums.body.BuildingType;
import cn.enilu.flash.service.system.impl.ConstantFactory;
import cn.enilu.flash.utils.StringUtils;

import java.util.List;
import java.util.Map;

/**
 * @Description
 * @Author Spark
 * @Date Created in (2019/10/30 14:06)
 * @Version v1.0
 * @Modify
 **/
public class BuildingInfoWarpper extends BaseControllerWarpper  {
    public BuildingInfoWarpper(List<Map<String, Object>> list) {
        super(list);
    }

    @Override
    public void warpTheMap(Map<String, Object> map) {
        map.put("typeName", BuildingType.valueOfCode((Integer) map.get("type")));
        if(StringUtils.isNotNullOrEmpty(map.get("communityId"))) {
            map.put("communityName", ConstantFactory.me().getCommunityNameById((Long) map.get("communityId")));
        }
    }
}
